Skip to content

Add option to remove empty function exports - #9078

Open
GtechGovind wants to merge 1 commit into
WebAssembly:mainfrom
GtechGovind:fix/remove-empty-exports
Open

Add option to remove empty function exports#9078
GtechGovind wants to merge 1 commit into
WebAssembly:mainfrom
GtechGovind:fix/remove-empty-exports

Conversation

@GtechGovind

Copy link
Copy Markdown

Fixes #6506.

Summary

  • add an opt-in remove-unused-module-elements-consider-empty-exports-unused pass argument
  • remove exports of defined functions whose bodies are empty while preserving imported and non-empty exports
  • let normal reachability analysis retain empty functions that are still used internally

Testing

  • full CMake build
  • Binaryen lit suite: 984 passed, 6 unsupported
  • C++ unit suite: 420 passed
  • legacy wasm-opt suite
  • focused empty-export lit regression test

@GtechGovind
GtechGovind marked this pull request as ready for review September 5, 2026 07:10
@GtechGovind
GtechGovind requested a review from a team as a code owner September 5, 2026 07:10
@GtechGovind
GtechGovind requested review from stevenfontanella and removed request for a team September 5, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to remove no-op exported functions?

1 participant